{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<img align=\"left\" style=\"padding-right:10px;\" src=\"figures/PHydro-cover-small.png\">\n",
    "*This is the Jupyter notebook version of the [Python in Hydrology](http://www.greenteapress.com/pythonhydro/pythonhydro.html) by Sat Kumar Tomer.*\n",
    "*Source code is available at [code.google.com](https://code.google.com/archive/p/python-in-hydrology/source).*\n",
    "\n",
    "*The book is available under the [GNU Free Documentation License](http://www.gnu.org/copyleft/fdl.html). If you have comments, corrections or suggestions, please send email to satkumartomer@gmail.com.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Types of Spatial Data](06.01-Types-of-Spatial-Data.ipynb) | [Contents](Index.ipynb) | [Writing Raster](06.03-Writing-Raster.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6.2 地理信息\n",
    "\n",
    "栅格数据可以通过指定`GeoTransform`变量或通过指定影像图的GCPs来进行地理参考。GeoTransform(GT)与地理坐标按照下面的方式关联，\n",
    "\n",
    "<center>$X_{geo}=GT[0]+X_{image}*GT[1]+Y_{image}*GT[2],\\quad\\quad\\quad\\quad\\quad$(6.1)<center>\n",
    "<center>$X_{geo}=GT[3]+X_{image}*GT[4]+Y_{image}*GT[5],\\quad\\quad\\quad\\quad\\quad$(6.2)<center>\n",
    "    \n",
    "其中，下标`geo`表示全局坐标，`image`表示影像地理坐标，即影像的像素和行数。在方括号([])内的的数字表示GT变量的索引。X和Y是坐标。$GT[2]$和$GT[4]$表示分别代表影像相对于地理坐标X和Y的方向，如果影像向北，则变为零。$GT[1]$表示像素宽度，$GT[5]$表示像素高度。$GT[0]$和$GT[4]$是栅格左上角像素左上角的位置。应该指出的是，在上面的像素/线坐标是从左上角像素的(0.0,0.0)到右下角像素的右下角。左上角像素的中心像素/线位置因此将是(0.5,0.5)。\n",
    "\n",
    "与地理参考有关的信息可以通过指定控制点来指定。控制点应该包含最小的$GCP_{Pixel}$(影像的像素数)、$GCP_{Line}$(影像的线条数)、$GCP_{X}$(X坐标),$GCP_{Y}$(Y坐标)，和$GCP_{Z}$(Z坐标)。(像素、线)的位置是栅格上的GCP的位置。(X,Y,Z)位置是相关的地理参考位置，Z通常为零。通常使用多项式将影像坐标(Pixel,Line)转换为地理参考坐标。\n",
    "\n",
    "通常一个数据集将包含一个仿射变换或GCPs。除了坐标与地理参考坐标有关外，坐标系统的名称也被赋给影像。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
